package com.qianfeng.openapi.web.master.handler;

import com.qianfeng.openapi.common.exception.OpenApiEx;
import com.qianfeng.openapi.web.master.bean.ResultVO;
import com.qianfeng.openapi.web.master.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class OpenApiExHandler {

    @ExceptionHandler(OpenApiEx.class)
    public ResultVO openApiEx(OpenApiEx ex){
        return R.error(ex.getStatus(),ex.getMessage());
    }

}
